/**
 * Created on 2018/8/11.
 */
package jetcache.samples.springboot;

import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.CacheUpdate;
import com.alicp.jetcache.anno.Cached;

import java.util.concurrent.TimeUnit;

/**
 * @author huangli
 */
public interface UserService {

    @Cached(name = "user", key = "#userId", expire = 10 * 60 * 60, localExpire = 10, syncLocal = true, cacheType = CacheType.BOTH)
    User loadUser(long userId);

    @CacheUpdate(name = "user", key = "#user.userId", value = "#user")
    void updateUser(User user);
}
